package com.yanqu.road.server.cmd.union.cross;

import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.pb.union.cross.CrossUnionProto;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.player.UserMgr;
import com.yanqu.road.server.manger.union.UnionMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_UNION_DETAIL, desc = "联盟详细信息")
public class GetUnionDetailCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CrossUnionProto.UnionDetailCrossReqMsg.Builder crossReq = CrossUnionProto.UnionDetailCrossReqMsg.newBuilder();
		UserBaseInfo baseInfo = UserMgr.getUserBaseInfo(player.getUserId(), GameServer.getInstance().getServerId());
		crossReq.setPlayerBaseData(PlayerBasePb.parsePlayerBaseTempMsg(baseInfo));
		player.sendPacket(Protocol.C_CROSS_UNION_DETAIL, crossReq);
	}

	@Override
	public void sendData(GamePlayer player) {

	}

}
